import wx

class CustSearchCtrl(wx.SearchCtrl):
    
    def __init__(self, parent, style=wx.TE_PROCESS_TAB):
        super().__init__(parent, style=style)

        self.IsCheckCapital = False
        self.IsCheckAll = False

        Menu = wx.Menu()
        Item1 = Menu.Append(-1, '区分大小写', '匹配时区分大小写', wx.ITEM_CHECK)
        Item2 = Menu.Append(-1, '全字段匹配', '需要所有字段完全相同才能匹配成功', wx.ITEM_CHECK)
        self.SetMenu(Menu)

        self.Bind(wx.EVT_MENU, self.OnCheckCapital, Item1)
        self.Bind(wx.EVT_MENU, self.OnCheckAll, Item2)

        self.ShowSearchButton(True)
        self.ShowCancelButton(True)

    def OnCheckCapital(self, event):
        self.IsCheckCapital = not self.IsCheckCapital

    def OnCheckAll(self, event):
        self.IsCheckAll = not self.IsCheckAll


class TestFrame(wx.Frame):
    def __init__(self, parent):
        wx.Frame.__init__(self, parent, -1, 'A Grid',
            size=(275,275))
        self.search_ctrl = CustSearchCtrl(self)
        sizer = wx.BoxSizer()
        sizer.Add(self.search_ctrl, wx.EXPAND)
        self.SetSizer(sizer)

    def search(self, event):
        pass

    def onSearchMenu(self, event):
        pass

if __name__ == "__main__":
    app = wx.PySimpleApp()
    frame = TestFrame(parent=None)
    frame.Show()

    app.MainLoop()